import React, {Component} from 'react';
import {Text,View} from 'react-native';
import PropTypes from 'prop-types';
export const fontFamily = {
    bold:"Gotham-Bold",
    book:"Gotham-Book",
    light:"Gotham-Light",
    medium:"Gotham-Medium"
}
export default class FontText extends Component {
    render() {
        let {font,style,height = 0} = this.props;
        let mstyle = {justifyContent: 'center'};
        if(height){
            mstyle.height = height;
        }
        return (
            <View style = {mstyle}>
                <Text {...this.props} style = {[{fontFamily:fontFamily[font]},style]}>
                    {this.props.children}
                </Text>
            </View>
        );
    }
}
FontText.propTypes = {
    font:PropTypes.oneOf(Object.keys(fontFamily)).isRequired
}